import http from "./index";

export default {
  // 登录
  login: (data) => http.post(`/login`, data),
  // 退出登录
  logout: () => http.post(`/api/logout`),
  // 使用openid登录
  openidLogin: (data) => http.post(`/api/loginByOpenid`, data),
  // 获取个人信息
  getUserInfo: () => http.get(`/api/getLoginInfo`),
  // 附件上传接口
  uploadFile: (data) => http.post(`/afffile/save`, data),
  // 获取租户配置
  getTenantCodeConfig: (id) => http.get(`/tenant/detailConfig/${id}`),

  //根据token获取当前账号的详细信息
  getAccountInfoByToken: () => http.get(`/api/account/detailaccount`),
  // ocr识别
  ocr: (data) => http.post(`/speaker/ocr`, data),
  // 签署协议
  signAgreement: (data) => http.post(`/meeting/uploadLaborAgreement`, data),
  // 头像切割
  portraitV2Avatar: (data) => http.post(`/speaker/portraitV2`, data),
  // 上传讲者头像
  uploadSpeakerAvatar: (data) =>
    http.post(`/speaker/uploadSpeakerAvatar`, data),

  // 获取会议列表
  meetingList: (data) => http.get(`/meeting/page`, data),
  // 获取会议设置
  meetingGetSetting: (projectId) =>
    http.get(`/meeting/getMeetingSetting/${projectId}`),
  // 申请会议
  // meetingApply: data => http.post(`/meeting/addMeeting`, data),
  meetingApply: (data, options) => http.post(`/meeting/apply`, data, options),
  // 暂存会议
  meetingTemporary: (data, options) =>
    http.post(`/meeting/meetingTemporary`, data, options),
  // 修改会议
  meetingUpdate: (data) => http.post(`/meeting/updateMeeting`, data),
  // 会议详情
  meetingDetail: (id) => http.get(`/meeting/${id}`),
  // 会议海报
  meetingPoster: (id) => http.get(`/meeting/meetingPoster/${id}`),
  // 会议结算
  meetingSettle: (data, options) =>
    http.post(`/meeting/meetingSettlement`, data, options),
  // 取消会议
  meetingCancel: (id) => http.post(`/meeting/cancelMeeting/${id}`),
  // 删除会议
  meetingDelete: (id) => http.post(`/meeting/delete/${id}`),
  // 取消会议
  meetingUploadPhoto: (data) => http.post(`/meeting/uploadPhoto`, data),

  // 获取讲者列表
  speakerList: (data) => http.get(`/speaker/getSpeakerList`, data),
  // 获取讲者详情
  speakerDetail: (id) => http.get(`/speaker/${id}`),
  // 新增讲者
  speakerAdd: (data) => http.post(`/speaker/add`, data),
  speakerDel: (id) => http.get(`/speaker/delete/${id}`),
  speakerAddScan: (data) => http.post(`/speaker/addForScan`, data),
  //讲者暂存
  speakerStorage: (data) => http.post("/speaker/tempSave", data),
  //去除照片背景-人像分割
  portrait: (data) => http.post(`/speaker/portrait`, data),

  // 获取直播详情
  getLiveDetail: (data) => http.get(`/api/live/info/${data.id}`, data),
  // 获取imid
  getImId: (data) => http.get(`/api/live/getImid/${data.id}`, data),
  // 心跳接口
  watchHeartbeat: (data) => http.post(`/api/heartbeat`, data),

  // 获取UserSign
  // getImUserSign: imId => http.get(`https://im.doctorworking.cn/getUserSign/${imId}`),
  getImUserSign: (imId) =>
    http.get(`https://im.skyfar.net/im/getUserSign/${imId}`),
  // 获取历史聊天记录(分页)
  // getImRecordPage: data => http.get('https://im.doctorworking.cn/getImRecordPage', data)
  getImRecordPage: (data) =>
    http.get("https://im.skyfar.net/im/getImRecordPage", data),
  // 保存听众信息
  saveAudienceForm: (data) => http.postMap(`/api/audience/saveforamis`, data),
  // 获取项目的收集听众信息的表单
  getProjectAmisForm: (id) => http.get(`/project/amisDetail/${id}`),
  //获取签协议的讲者信息
  getSignSpeaker: (data) =>
    http.get(`/meeting/getSpeakerInfo/${data.meetingId}/${data.speakerId}`),

  //生成会议海报
  generatePoster: (id) => http.get(`/meeting/createPoster/${id}`),
  //获取会议详情
  getMeetingDetailById: (id) => http.get(`/meeting/${id}`),
};
